import { post, get, ResponseType } from './request'
const commonService = {
    /**
     * 文件直传
     */
    uploadFileDirect() {
        return post('/file/uploadFileDirect')
            .then((resp: any) => resp.data);
    },
    /**
     * 用户标签
     */
    queryUserTags() {
        return post('/admin/userTags/all')
            .then((resp: any) => resp.data);
    }
}
/**
 * 后台用户
 */
const userService = {
    /**
     * 登录
     */
    login({ username, password }) {
        return post('/admin/buser/login', {
            params: { username, password }
        })
            .then((resp) => resp);
    },
    /**
     * 创建用户
     */
    createUser() {
        return post('/admin/user/create')
    },
    /**
     * 修改用户
     */
    updateUser() {
        return post('/admin/user/update')
    },
    /**
     * 查询用户
     */
    queryUser({ nickname, username, id, page, pageSize }) {
        return post('/admin/user/query', {
            params: {
                nickname,
                username,
                id,
                page,
                pageSize
            }
        }).then((resp: any) => resp.data)
    },
    /**
     * 通过组织ID和角色ID查询用户信息
     */
    queryUserByOrgRole({ orgId, roleId }) {
        return post('/admin/user/queryUserByOrgRole', {
            params: {
                orgId,
                roleId
            }
        }).then((resp: any) => resp.data)
    },
    /**
     * 查询所有用户角色
     */
    queryAllRoles() {
        return post('/admin/role/selectAll').then((resp: any) => resp.data)
    }
}

/**
 * 专家
 */
const expertService = {
    /**
     * 创建专家
     */
    createExpert({
        nickname,
        expertDesc,
        expertRoleId,
        expertRoleName,
        hPortrait,
    }) {
        return post('/admin/expert/create', {
            params: {
                nickname,
                expertDesc,
                expertRoleId,
                expertRoleName,
                hPortrait,
            }
        }).then((resp: any) => resp.data)
    },
    /**
     * 更新专家
     */
    updateExpert({
        id,
        expertDesc,
        expertRoleName,
        hPortrait,
        nickname,
    }) {
        return post('/admin/expert/update', {
            params: {
                id,
                expertDesc,
                expertRoleName,
                hPortrait,
                nickname,
            }
        }).then((resp: any) => resp.data)
    },
    /**
     * 删除专家
     */
    deleteExpert({
        id
    }) {
        return post('/admin/expert/delete', {
            params: {
                id
            }
        }).then((resp: any) => resp.data)
    },
    /**
     * 查询专家
     */
    queryExpert({
        page,
        nickname,
        pageSize
    }) {
        return post('/admin/expert/query', {
            params: {
                page,
                pageSize,
                nickname,
            }
        }).then((resp: any) => resp.data)
    },
    /**
     * 查询所有专家
     */
    queryAllExpert() {
        return post('/admin/expert/list').then((resp: any) => resp.data)
    },

    /**
     * 查询所有资料resName
     */
    queryBindResource({
                        name
                }) {
      return post('/admin/subject-res-rel/queryRes', {
        params: {
          name
        }
      }).then((resp: any) => resp.data)
    },

  queryAllAihao() {
    return get('/admin/interest/list').then((resp: any) => resp.data)
  },

  queryAllParentList() {
    return get('/admin/banner/bannerPrefix').then((resp: any) => resp.data)
  },

    querymsBindResource({
                        name
                      }) {
      return post('/admin/subject-res-rel/queryRes', {
        params: {
          name
        }
      }).then((resp: any) => resp.data)
    },

    BindzjResource({
                     resId,
                     subjectId
                      }) {
      return post('/admin/subject-res-rel/add', {
        params: {
          resId,
          subjectId
        }
      }).then((resp: any) => resp.data)
    },

  BindmsResource({
                   resId,
                   studioId
                 }) {
    return post('/admin/studio-res-rel/add', {
      params: {
        resId,
        studioId
      }
    }).then((resp: any) => resp.data)
  },
    queryzjResource({
                     subjectId,
                      type
                   }) {
      return get('/admin/subject-res-rel/queryBind', {
        params: {
          subjectId,
          type
        }
      }).then((resp: any) => resp.data)
    },
  querymsResource({
                    studioId,type
                  }) {
    return post('/admin/studio-res-rel/queryBind', {
      params: {
        studioId,type
      }
    }).then((resp: any) => resp.data)
  },
  deletezlBind({
                 id
               }) {
    return post('/admin/subject-res-rel/delete', {
      params: {
        id
      }
    }).then((resp: any) => resp.data)
  },

  changesort({
               resRelId,
               order,
               subjectId
               }) {
    return get('/admin/subject-res-rel/setOrder', {
      params: {
        resRelId,
        order,
        subjectId
      }
    }).then((resp: any) => resp.data)
  },
  deletemsBind({
                 id
               }) {
    return post('/admin/studio-res-rel/delete', {
      params: {
        id
      }
    }).then((resp: any) => resp.data)
  },
    /**
     * 查询专家职位
     */
    queryExpertRoles() {
        return post('/admin/expert/queryRoles').then((resp: any) => resp.data)
    },
}

/**
 * 名师
 */
const masterService = {
    /**
     * 创建名师
     */
    queryMasterRoles() {
        return post('/admin/famous-teacher/queryRoles').then((resp: any) => resp.data)
    },
    /**
     * 查询名师
     */
    queryMaster({
        page,
        nickname,
        pageSize
    }) {
        return post('/admin/famous-teacher/query', {
            params: {
                page,
                pageSize,
                nickname,
            }
        }).then((resp: any) => resp.data)
    },
    /**
     * 查询名师
     */
    queryAllMaster() {
        return post('/admin/famous-teacher/selectAll').then((resp: any) => resp.data)
    },
    /**
     * 创建名师
     */
    createMaster({
        nickname,
        domain,
        description,
        orgName,
        portraitImg,
        roleId,
        roleName
    }) {
        return post('/admin/famous-teacher/create', {
            params: {
                nickname,
                domain,
                description,
                orgName,
                portraitImg,
                roleId,
                roleName
            }
        }).then((resp: any) => resp.data)
    },
    /**
     * 修改名师
     */
    updateMaster({
        id,
        nickname,
        domain,
        description,
        orgName,
        portraitImg,
        roleId,
        roleName
    }) {
        return post('/admin/famous-teacher/update', {
            params: {
                id,
                nickname,
                domain,
                description,
                orgName,
                portraitImg,
                roleId,
                roleName
            }
        }).then((resp: any) => resp.data)
    },
    /**
     * 修改名师
     */
    deleteMaster({
        id
    }) {
        return post('/admin/famous-teacher/delete', {
            params: {
                id
            }
        }).then((resp: any) => resp.data)
    },
}

/**
 * 园所审批
 */
const orgApplyService = {
    getApplyOrgs({ orgName, page, pageSize }) {
        return post('/admin/org-apply/query', {
            params: {
                orgName,
                page,
                pageSize
            }
        }).then((resp: any) => resp.data)
    },
    orgAgree({ id, orgId }) {
        return post('/admin/org-apply/agree', {
            params: {
                id,
                orgId
            }
        }).then((resp: any) => resp.data)
    },
    orgReject({ id, orgId }) {
        return post('/admin/org-apply/reject', {
            params: {
                id,
                orgId
            }
        }).then((resp: any) => resp.data)
    },
}

/**
 * 园所组织
 */
const orgService = {
    /**
     * 查询机构
     */
    queryOrgs({
        name,
        page,
        pageSize
    }) {
        return post('/admin/org/query', {
            params: {
                name,
                page,
                pageSize
            }
        }).then((resp: any) => resp.data)
    },
    /**
     * 查询机构
     */
    queryAllOrgs(name?: string) {
        return post('/admin/famous-org/queryQualifiedOrg', {
            params: {
                name,
            }
        }).then((resp: any) => resp.data)
    },
    /**
     *
     * 查看详情
     */
    queryDetail({ id }) {
        return post('/admin/org/queryDetail', {
            params: {
                id
            }
        }).then((resp: any) => resp.data)
    },
    /**
     * 创建机构
     */
    createOrg({
        chargeUsername,
        location,
        name,
        personnelScale,
        remark,
        tel,
        logoPic,
        coverPic
    }) {
        return post('/admin/org/add', {
            params: {
                chargeUsername,
                location,
                name,
                personnelScale,
                remark,
                tel,
                logoPic,
                coverPic
            }
        }).then((resp: any) => resp.data)
    },
    /**
     * 修改机构
     */
    updateOrg({
        id,
        chargeUsername,
        location,
        name,
        personnelScale,
        remark,
        tel,
        logoPic,
        coverPic
    }) {
        return post('/admin/org/update', {
            params: {
                id,
                chargeUsername,
                location,
                name,
                personnelScale,
                remark,
                tel,
                logoPic,
                coverPic
            }
        }).then((resp: any) => resp.data)
    },
}

/**
 * 首页 banner管理
 */
const homeBannerService = {
    /**
     * 查询机构
     */
    queryBanner() {
        return post('/admin/banner/query', {
            params: { page: 1, pageSize: 10 }
        }).then((resp: any) => resp.data)
    },
    /**
     * 创建
     */
    createBanner({
        name, remark, type, content, picUrl,prefixType,suffixId
    }) {
        return post('/admin/banner/create', {
            params: {
                name, remark, type, content, picUrl,prefixType,suffixId
            }
        }).then((resp: any) => resp.data)
    },


    /**
     * 修改
     */
    updateBanner({
        name, remark, type, content, picUrl, id,prefixType,suffixId
    }) {
        return post('/admin/banner/update', {
            params: {
                name, remark, type, content, picUrl, id,prefixType,suffixId
            }
        }).then((resp: any) => resp.data)
    },

  createGroup({
                groupName,valueNames
               }) {
    return post('/admin/shopSkuPropertyGroup/addGoodsSkuGroupInfo', {
      params: {
        groupName,valueNames
      }
    }).then((resp: any) => resp.data)
  },


  /**
   * 修改
   */
  updateGroup({
                groupName,valueNames,id
               }) {
    return post('/admin/shopSkuPropertyGroup/updateGoodsSkuGroupInfo', {
      params: {
        groupName,valueNames,groupId:id
      }
    }).then((resp: any) => resp.data)
  },

  deleveryOrder({
                  id,deliverOrder
              }) {
    return post('/admin/jy-shop-order/deliverOrder', {
      params: {
        orderId:id,kuaidiCode:deliverOrder
      }
    }).then((resp: any) => resp.data)
  },
    /**
     * 删除
     */
    deleteBanner({ id }) {
        return post('/admin/banner/delete', {
            params: { id }
        }).then((resp: any) => resp.data)
    },
}

/**
 * 理论百家宴
 */
const theoryFeastService = {
    /**
     * 查询
     */
    queryTheoryFeast({ page, pageSize, title }) {
        return post('/admin/theory-feast/query', {
            params: { page, pageSize, title }
        }).then((resp: any) => resp.data)
    },
    /**
     * 创建
     */
    createTheoryFeast({
        content,
        imgs,
        resource,
        title
    }) {
        return post('/admin/theory-feast/add', {
            params: {
                content,
                imgs,
                resource,
                title
            }
        }).then((resp: any) => resp.data)
    },
    /**
     * 更新
     */
    updateTheoryFeast({
        id,
        content,
        imgs,
        resource,
        title
    }) {
        return post('/admin/theory-feast/update', {
            params: {
                id,
                content,
                imgs,
                resource,
                title
            }
        }).then((resp: any) => resp.data)
    },
    /**
     * 删除
     */
    deleteTheoryFeast({ id }) {
        return post('/admin/theory-feast/delete', {
            params: { id }
        }).then((resp: any) => resp.data)
    },
    /**
     * 上架
     */
    onlineTheoryFeast(id) {
        return post('/admin/theory-feast/grounding', {
            params: { id }
        }).then((resp: any) => resp.data)
    },
    /**
     * 下架
     */
    offlineTheoryFeast(id) {
        return post('/admin/theory-feast/underCarriage', {
            params: { id }
        }).then((resp: any) => resp.data)
    },

}

/**
 * 成长路线
 */
const growthService = {
    /**
     * 查询
     */
    queryGrowthPath({ page, pageSize, nickname }) {
        return post('/admin/growth-path/query', {
            params: { page, pageSize, nickname }
        }).then((resp: any) => resp.data)
    },
    /**
     * 创建
     */
    createGrowthPath({ orgId, type, username }) {
        return post('/admin/growth-path/create', {
            params: { orgId, type, username }
        }).then((resp: any) => resp.data)
    },
    /**
     * 删除
     */
    deleteGrowthPath(id) {
        return post('/admin/growth-path/delete', {
            params: { id }
        }).then((resp: any) => resp.data)
    },
    onlineGrowthPath(id) {
        return post('/admin/growth-path/grounding', {
            params: { id }
        }).then((resp: any) => resp.data)
    },
    offlineGrowthPath(id) {
        return post('/admin/growth-path/undercarriage', {
            params: { id }
        }).then((resp: any) => resp.data)
    }
}

/**
 * 专家演播室
 */
const expertStudioService = {
    /**
     * 查询
     */
    queryExpertStudio({ page, pageSize, name }) {
        return post('/admin/subject/query', {
            params: { page, pageSize, name }
        }).then((resp: any) => resp.data)
    },
    /**
     * 创建
     */
    createExpertStudio({ name, price, authorId, startTime, subjectDesc, isBanner, coverImg, expertDesc }) {
        return post('/admin/subject/add', {
            params: { name, price, authorId, startTime, subjectDesc, isBanner, coverImg, expertDesc }
        }).then((resp: any) => resp.data)
    },
    /**
     * 修改
     */
    updateExpertStudio({ id, name, price, authorId, startTime, subjectDesc, isBanner, coverImg, expertDesc }) {
        return post('/admin/subject/update', {
            params: { id, name, price, authorId, startTime, subjectDesc, isBanner, coverImg, expertDesc }
        }).then((resp: any) => resp.data)
    },
    /**
     * 删除
     */
    // deleteExpertStudio(id) {
    //     return post('/admin/teacher-studio/delete', {
    //         params: { id }
    //     }).then((resp: any) => resp.data)
    // },
    onlineExpertStudio(id) {
        return post('/admin/subject/grounding', {
            params: { id }
        }).then((resp: any) => resp.data)
    },
    offlineExpertStudio(id) {
        return post('/admin/subject/undercarriage', {
            params: { id }
        }).then((resp: any) => resp.data)
    },
  onlineBanner(id) {
    return get('/admin/banner/grounding', {
      params: { id }
    }).then((resp: any) => resp.data)
  },
  offlineBanner(id) {
    return get('/admin/banner/undercarriage', {
      params: { id }
    }).then((resp: any) => resp.data)
  },
  onlineDocument(id) {
    return get('/admin/resource/grounding', {
      params: { id }
    }).then((resp: any) => resp.data)
  },
  onlineStoreDocument(id) {
    return get('/admin/shopresource/grounding', {
      params: { id }
    }).then((resp: any) => resp.data)
  },
  offlineDocument(id) {
    return get('/admin/resource/undercarriage', {
      params: { id }
    }).then((resp: any) => resp.data)
  },


  offlineStoreDocument(id) {
    return get('/admin/shopresource/undercarriage', {
      params: { id }
    }).then((resp: any) => resp.data)
  },

  deleteGroup(id) {
    return post('/admin/shopSkuPropertyGroup/removeGoodsSkuGroupInfo', {
      params: { groupId:id }
    }).then((resp: any) => resp.data)
  }
}

/**
 * 名师工作室
 */
const teacherStudioService = {
    /**
     * 查询
     */
    queryTeacherStudio({ page, pageSize, nickname }) {
        return post('/admin/teacher-studio/query', {
            params: { page, pageSize, nickname }
        }).then((resp: any) => resp.data)
    },
    /**
     * 创建
     */
    createTeacherStudio({ fTeacherId, coverImg, isBanner, studioDesc }) {
        return post('/admin/teacher-studio/create', {
            params: { fTeacherId, coverImg, isBanner, studioDesc }
        }).then((resp: any) => resp.data)
    },
    /**
     * 修改
     */
    updateTeacherStudio({ id, fTeacherId, coverImg, isBanner, studioDesc }) {
        return post('/admin/teacher-studio/update', {
            params: { id, fTeacherId, coverImg, isBanner, studioDesc }
        }).then((resp: any) => resp.data)
    },
    /**
     * 删除
     */
    deleteTeacherStudio(id) {
        return post('/admin/teacher-studio/delete', {
            params: { id }
        }).then((resp: any) => resp.data)
    },
    onlineTeacherStudio(id) {
        return post('/admin/teacher-studio/grounding', {
            params: { id }
        }).then((resp: any) => resp.data)
    },
    offlineTeacherStudio(id) {
        return post('/admin/teacher-studio/undercarriage', {
            params: { id }
        }).then((resp: any) => resp.data)
    }
}

/**
 * 名园风采录
 */
const famousOrgService = {
    /**
     * 查询
     */
    queryFamousOrg({ page, pageSize, org_name }) {
        return post('/admin/famous-org/query', {
            params: { page, pageSize, org_name }
        }).then((resp: any) => resp.data)
    },
    /**
     * 创建
     */
    createFamousOrg({ orgId, coverImg, isBanner, gardenDesc, adminDesc,members,foundTime }) {
        return post('/admin/famous-org/add', {
            params: { orgId, coverImg, isBanner, gardenDesc, adminDesc ,members,foundTime}
        }).then((resp: any) => resp.data)
    },
    /**
     * 修改
     */
    updateFamousOrg({ id, orgId, coverImg, isBanner, gardenDesc, adminDesc,members,foundTime }) {
        return post('/admin/famous-org/update', {
            params: { id, orgId, coverImg, isBanner, gardenDesc, adminDesc,members,foundTime }
        }).then((resp: any) => resp.data)
    },
    /**
     * 删除
     */
    deleteFamousOrg(id) {
        return post('/admin/famous-org/delete', {
            params: { id }
        }).then((resp: any) => resp.data)
    },
    onlineFamousOrg(id) {
        return post('/admin/famous-org/grounding', {
            params: { id }
        }).then((resp: any) => resp.data)
    },
    offlineFamousOrg(id) {
        return post('/admin/famous-org/undercarriage', {
            params: { id }
        }).then((resp: any) => resp.data)
    }
}

/**
 * 培训百宝箱
 */
const trainBoxService = {
    /**
     * 查询
     */
    queryTrainBox({ page, pageSize, org_name }) {
        return post('/admin/train-box/query', {
            params: { page, pageSize, org_name }
        }).then((resp: any) => resp.data)
    },
    /**
     * 创建
     */
    createTrainBox({ isBanner, startTime, title, summry, type, coverImg, content }) {
        return post('/admin/train-box/add', {
            params: { isBanner, startTime, title, summry, type, coverImg, content }
        }).then((resp: any) => resp.data)
    },
    /**
     * 修改
     */
    updateTrainBox({ id, isBanner, startTime, title, summry, type, coverImg, content }) {
        return post('/admin/train-box/update', {
            params: { id, isBanner, startTime, title, summry, type, coverImg, content }
        }).then((resp: any) => resp.data)
    },
    /**
     * 删除
     */
    deleteTrainBox(id) {
        return post('/admin/train-box/delete', {
            params: { id }
        }).then((resp: any) => resp.data)
    },
    onlineTrainBox(id) {
        return post('/admin/train-box/grounding', {
            params: { id }
        }).then((resp: any) => resp.data)
    },
    offlineTrainBox(id) {
        return post('/admin/train-box/undercarriage', {
            params: { id }
        }).then((resp: any) => resp.data)
    }
}

/**
 * 文件管理
 */
const dataBaseService = {
    /**
        * 查询
        */
    queryResource({ page, pageSize, name }) {
        return post('/admin/resource/query', {
            params: { page, pageSize, name ,type:1}
        }).then((resp: any) => resp.data)
    },

  queryStoreResource({ page, pageSize, name }) {
    return post('/admin/shopresource/query', {
      params: { page, pageSize, name }
    }).then((resp: any) => resp.data)
  },

    queryGroup({ name }) {
      return post('/admin/shopSkuPropertyGroup/listGoodsSkuGroup', {
        params: {  name }
      }).then((resp: any) => resp.data)
    },
    queryvmResource({ page, pageSize, name }) {
      return post('/admin/resource/query', {
        params: { page, pageSize, name ,type:5}
      }).then((resp: any) => resp.data)
    },

    queryUnbindResource({ pageNum, pageSize, name,subjectId ,type}) {
      return get('/admin/subject-res-rel/queryUnbind', {
        params: { pageNum, pageSize, name, subjectId,type }
      }).then((resp: any) => resp.data)
    },

  querymsUnbindResource({ pageNum, pageSize, name,studioId,type }) {
    return get('/admin/studio-res-rel/queryUnbind', {
      params: { pageNum, pageSize, name, studioId ,type}
    }).then((resp: any) => resp.data)
  },
    /**
     * 创建
     */
    createResource({ coverImg,
        authorPortrait,
        url,
        name,
        type,
        author,
        keywords,
        tags,
        price,
        description,
        summary }) {
        return post('/admin/resource/add', {
            params: {
                coverImg,
                authorPortrait,
                url,
                name,
                type,
                author,
                keywords,
                summary,
                price,
                tags,
                description
            }
        }).then((resp: any) => resp.data)
    },
  /**
   * 创建
   */
  createStoreResource({ coverImg,
                   authorPortrait,
                   url,
                   name,
                   type,
                   author,
                   keywords,
                   tags,
                  isVip,
                   summary }) {
    return post('/admin/shopresource/add', {
      params: {
        coverImg,
        authorPortrait,
        url,
        name,
        type,
        author,
        keywords,
        summary,
        isVip,
        tags
      }
    }).then((resp: any) => resp.data)
  },

  /**
   * 修改
   */
  updateStoreResource({
                   id,
                   coverImg,
                   authorPortrait,
                   url,
                   name,
                   type,
                   author,
                   keywords,
                   summary,
                   isVip,
                   tags
                 }) {
    return post('/admin/shopresource/update', {
      params: {
        id,
        coverImg,
        authorPortrait,
        url,
        name,
        type,
        author,
        keywords,
        summary,
        isVip,
        tags
      }
    }).then((resp: any) => resp.data)
  },

    /**
     * 修改
     */
    updateResource({
        id,
        coverImg,
        authorPortrait,
        url,
        name,
        type,
        author,
        keywords,
        summary,
        price,
        tags,
        description
    }) {
        return post('/admin/resource/update', {
            params: {
                id,
                coverImg,
                authorPortrait,
                url,
                name,
                type,
                author,
                keywords,
                summary,
                price,
                tags,
                description
            }
        }).then((resp: any) => resp.data)
    },
}

/**
 * 园所百宝箱
 */
const orgBoxService = {

    /**
     * 查询
     */
    queryboxselect({mtype }) {
      return get('/admin/treasureBox/module', {
        params: { moduleId:mtype }
      }).then((resp: any) => resp.data)
    },

    queryWorkselect({mtype }) {
      return get('/admin/workTreasureBox/getModuleByRoleId', {
        params: { roleId:mtype }
      }).then((resp: any) => resp.data)
    },
    /**
    * 查询
    */
    queryTreasureBox({ page, pageSize, moduleId }) {
        return post('/admin/treasureBox/query', {
            params: { page, pageSize, moduleId }
        }).then((resp: any) => resp.data)
    },
    /**
    * 创建
    */
    createTreasureBox({
        coverImg,
        authorPortrait,
        url,
        name,
        type,
        author,
        keywords,
        summary,
        tags,
        moduleId,
        description
    }) {
        return post('/admin/treasureBox/add', {
            params: {
              coverImg,
              authorPortrait,
              url,
              name,
              type,
              author,
              keywords,
              summary,
              tags,
              moduleId,
              description
            }
        }).then((resp: any) => resp.data)
    },
    /**
    * 删除
    */
    deleteTreasureBox({ id }) {
        return post('/admin/treasureBox/delete', {
            params: { id }
        }).then((resp: any) => resp.data)
    },
    /**
    * 上架
    */
    onlineTreasureBox({ id }) {
        return post('/admin/treasureBox/grounding', {
            params: { id }
        }).then((resp: any) => resp.data)
    },
    /**
    * 下架
    */
    offlineTreasureBox({ id }) {
        return post('/admin/treasureBox/undercarriage', {
            params: { id }
        }).then((resp: any) => resp.data)
    },
}

/**
 * 工作百宝箱
 */
const workService = {
    /**
    * 查询
    */
    queryWorkTreasureBox({ page, pageSize, roleId }) {
        return post('/admin/workTreasureBox/query', {
            params: { page, pageSize, roleId }
        }).then((resp: any) => resp.data)
    },
    /**
    * 创建
    */
    createWorkTreasureBox({
        coverImg,
        authorPortrait,
        url,
        name,
        type,
        author,
        keywords,
        summary,
        tags,
        roleId,
        moduleId,
        description
    }) {
        return post('/admin/workTreasureBox/add', {
            params: {
              coverImg,
              authorPortrait,
              url,
              name,
              type,
              author,
              keywords,
              summary,
              tags,
              roleId,
              moduleId,
              description
            }
        }).then((resp: any) => resp.data)
    },
    /**
    * 删除
    */
    deleteWorkTreasureBox({ id }) {
        return post('/admin/workTreasureBox/delete', {
            params: { id }
        }).then((resp: any) => resp.data)
    },
    /**
    * 上架
    */
    onlineWorkTreasureBox({ id }) {
        return post('/admin/workTreasureBox/grounding', {
            params: { id }
        }).then((resp: any) => resp.data)
    },
    /**
    * 下架
    */
    offlineWorkTreasureBox({ id }) {
        return post('/admin/workTreasureBox/undercarriage', {
            params: { id }
        }).then((resp: any) => resp.data)
    },
}

/**
 * 商城
 */
const shoppingmallService = {
    /**
    * 查询订单
    */
    queryListOrderPage({ page, pageSize }) {
        return post('/admin/jy-shop-order/listOrderPage', {
            params: { page, pageSize }
        }).then((resp: any) => resp.data)
    },
    /**
    * 查询退款订单
    */
    queryChargeBackListPage({ page, pageSize }) {
        return post('/admin/jy-shop-refund/listGoodsPage', {
            params: { page, pageSize }
        }).then((resp: any) => resp.data)
    },
    /**
     * @desc 首页商品分页
     * @param param0
     */
    queryListHomeGoodsPage({ page, pageSize, title }) {
        return post('/admin/jy-shop-goods/listHomeGoodsPage', {
            params: { page, pageSize, title }
        }).then((resp: any) => resp.data)
    },
    /**
    * 查询商品
    */
    queryListGoodsPage({ page, pageSize, title }) {
        return post('/admin/jy-shop-goods/listGoodsPage', {
            params: { page, pageSize, title }
        }).then((resp: any) => resp.data)
    },
    /**
    * 创建
    */
    deleteGoodById({
        id
    }) {
        return post('/admin/jy-shop-goods/deleteGoods', {
            params: {
                id
            }
        }).then((resp: any) => resp.data)
    },
    /**
    * 创建
    */
    createGoodsInfo({
        cid,
        description,
        imgs,
        price,
        title,
        type,
        virtualAddress,
        groupIds,
        skuInfoList
    }) {
        return post('/admin/jy-shop-goods/addGoodsInfo', {
            params: {
                cid,
                description,
                imgs,
                price,
                title,
                type,
                virtualAddress,
              groupIds,
              skuInfoList
            }
        }).then((resp: any) => resp.data)
    },
    /**
    * 修改
    */
    updateGoodsInfo({
        id,
        cid,
        description,
        imgs,
        price,
        title,
        type,
        virtualAddress,
        groupIds,
        skuInfoList
    }) {
        return post('/admin/jy-shop-goods/updateGoodsInfo', {
            params: {
                id,
                cid,
                description,
                imgs,
                price,
                title,
                type,
                virtualAddress,
              groupIds,
              skuInfoList
            }
        }).then((resp: any) => resp.data)
    },
    /**
    * 下架
    */
    offlineGoodsStatus({
        id,
    }) {
        return post('/admin/jy-shop-goods/downGoods', {
            params: {
                id
            }
        }).then((resp: any) => resp.data)
    },
    /**
    * 上架
    */
    onlineGoodsStatus({
        id,
    }) {
        return post('/admin/jy-shop-goods/upGoods', {
            params: {
                id
            }
        }).then((resp: any) => resp.data)
    },
    /**
    * 设置推荐
    */
    setGoodsHot({
        id,
    }) {
        return post('/admin/jy-shop-goods/setGoodsHot', {
            params: {
                id,
            }
        }).then((resp: any) => resp.data)
    },
    /**
    * 取消设置推荐
    */
    cancelSetGoodsHot({
        id,
    }) {
        return post('/admin/jy-shop-goods/cancelGoodsHot', {
            params: {
                id,
            }
        }).then((resp: any) => resp.data)
    },

    /**
     * 设置首页商品
     */
    setHomeGoods({
        id,
    }) {
        return post('/admin/jy-shop-goods/setHomeGoods', {
            params: {
                id,
            }
        }).then((resp: any) => resp.data)
    },
    /**
     * 取消设置首页商品
     */
    cancelHomeGoods({
        id,
    }) {
        return post('/admin/jy-shop-goods/cancelHomeGoods', {
            params: {
                id,
            }
        }).then((resp: any) => resp.data)
    },
}

const billService = {
    /**
    * 查询账单流水
    */
    queryBillList({ page, pageSize, payCode }) {
        return post('/admin/jy-pay-log/listPage', {
            params: { page, pageSize, payCode }
        }).then((resp: any) => resp.data)
    },

}

export default {
    ...commonService,
    ...userService,
    ...orgApplyService,
    ...expertService,
    ...masterService,
    ...orgService,
    ...homeBannerService,
    ...theoryFeastService,
    ...growthService,
    ...expertStudioService,
    ...teacherStudioService,
    ...famousOrgService,
    ...trainBoxService,
    ...dataBaseService,
    ...orgBoxService,
    ...workService,
    ...shoppingmallService,
    ...billService
}
